﻿namespace Chain.Wechat
{
    using System;
    using System.Runtime.CompilerServices;
    using System.Xml;

    public class NewsResponseItem
    {
        
        private string _Description;
        
        private string _PicUrl;
        
        private string _Title;
        
        private string _Url;
        
        private XmlDocument _XmlDoc;

        public NewsResponseItem(string title, string description, string picUrl, string url)
        {
            this.Title = title;
            this.Description = description;
            this.PicUrl = picUrl;
            this.Url = url;
            this.XmlDoc = new XmlDocument();
            XmlElement xml = this.XmlDoc.CreateElement("item");
            XmlElement nodeTitle = this.XmlDoc.CreateElement("Title");
            XmlCDataSection xmlCData = this.XmlDoc.CreateCDataSection(title);
            nodeTitle.AppendChild(xmlCData);
            xml.AppendChild(nodeTitle);
            XmlElement nodeDescription = this.XmlDoc.CreateElement("Description");
            xmlCData = this.XmlDoc.CreateCDataSection(description);
            nodeDescription.AppendChild(xmlCData);
            xml.AppendChild(nodeDescription);
            XmlElement nodePicUrl = this.XmlDoc.CreateElement("PicUrl");
            xmlCData = this.XmlDoc.CreateCDataSection(picUrl);
            nodePicUrl.AppendChild(xmlCData);
            xml.AppendChild(nodePicUrl);
            XmlElement nodeUrl = this.XmlDoc.CreateElement("Url");
            xmlCData = this.XmlDoc.CreateCDataSection(url);
            nodeUrl.AppendChild(xmlCData);
            xml.AppendChild(nodeUrl);
            this.XmlDoc.AppendChild(xml);
        }

        public string Description
        {
            
            get
            {
                return this._Description;
            }
            
            set
            {
                this._Description = value;
            }
        }

        public string PicUrl
        {
            
            get
            {
                return this._PicUrl;
            }
            
            set
            {
                this._PicUrl = value;
            }
        }

        public string Title
        {
            
            get
            {
                return this._Title;
            }
            
            set
            {
                this._Title = value;
            }
        }

        public string Url
        {
            
            get
            {
                return this._Url;
            }
            
            set
            {
                this._Url = value;
            }
        }

        public XmlDocument XmlDoc
        {
            
            get
            {
                return this._XmlDoc;
            }
            
            set
            {
                this._XmlDoc = value;
            }
        }
    }
}

